package org.jeecg.modules.nurse_user.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.nurse_user.entity.NurseUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: 用户管理
 * @Author: jeecg-boot
 * @Date: 2024-06-09
 * @Version: V1.0
 */
public interface NurseUserMapper extends BaseMapper<NurseUser> {

    @Delete("delete from nurse_user where id = #{id}")
    void deleteNurseUser(@Param("id") String id);

    @Delete("delete from nurse_user_family where user_id = #{id}")
    void deleteNurseUserFamily(@Param("id") String id);

    @Delete("delete from nurse_user_orders where user_id = #{id}")
    void deleteNurseUserOrders(@Param("id") String id);

    @Delete("delete from nurse_user_orders_detail where order_id in (select id from  nurse_user_orders where user_id=#{id})")
    void deleteNurseUserOrdersDetail(@Param("id") String id);

    @Delete("delete from medication_order where user_id = #{id}")
    void deleteMedicationOrder(@Param("id") String id);

    @Delete("delete from nurseuser_profile where openid = #{openid}")
    void deleteNurseUserProfile(@Param("openid") String openid);

    @Delete("delete from nurse_nurses where openid = #{openid}")
    void deleteNurseNurses(@Param("openid") String openid);
}
